local skill = fk.CreateSkill {
  name = "#ling__overlord_spear_skill",
  attached_equip = "ling__overlord_spear",
}

Fk:loadTranslationTable{
  ["#ling__overlord_spear_skill"] = "霸王枪",
  ["#ling__overlord_spear-slash"] = "霸王枪：你可以使用一张不能被抵消的【杀】",
}

local spec = {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skill.name) and data.card.trueName == "jink" and
      player:canUse(Fk:cloneCard("slash"), { bypass_times = true })
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local use = room:askToUseCard(player, {
      pattern = "slash",
      skill_name = skill.name,
      prompt = "#ling__overlord_spear-slash",
      extra_data = {
        bypass_times = true,
      },
    })
    if use then
      event:setCostData(self, {extra_data = use})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local use = event:getCostData(self).extra_data
    use.unoffsetableList = table.simpleClone(room.players)
    use.extraUse = true
    room:useCard(use)
  end,
}
skill:addEffect(fk.CardUsing, spec)
skill:addEffect(fk.CardResponding, spec)

return skill
